package expriment3_bag;

public class Fifteen {
    public static void main(String[] args) {
                int rows = 10;
                int[][] triangle = new int[rows][];

                for (int i = 0; i < rows; i++) {
                    triangle[i] = new int[i + 1];
                    for (int j = 0; j <= i; j++) {
                        if (j == 0 || j == i) {
                            triangle[i][j] = 1;
                        } else {
                            triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j];
                        }
                    }
                }
                for (int i = 0; i < rows; i++) {
                    for (int j = 0; j <= i; j++) {
                        System.out.print(triangle[i][j] + "\t");
                    }
                    System.out.println();
                }
            }
        }